package com.zhen.service.impl;

import java.sql.Types;
import java.util.List;
import java.util.Map;

import org.springframework.jdbc.core.JdbcTemplate;

import com.zhen.service.TestDao;

public class TestDaoTenplate implements TestDao {
	private JdbcTemplate jdbcTemplate;
	
	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

	@Override
	public void getAllCourse() {
		// TODO Auto-generated method stub
//		List<?> courseList=jdbcTemplate.queryForList("SELECT * FROM TEACHER");
		List<?> courseList=jdbcTemplate.queryForList("SELECT * FROM TEACHER WHERE T_ID=? AND T_NAME=?",new Object[]{1,"LIU"},new int[]{Types.INTEGER,Types.VARCHAR}); 
//		System.out.println(courseList.size());
		for(int i=0;i<courseList.size();i++)
		{
			Map<?, ?>map=(Map<?, ?>) courseList.get(i);
			System.out.println(map.get("T_ID"));
			System.out.println(map.get("T_NAME"));
		}
	}

}
